package com.lxx.onlineview.mapper;

import com.lxx.onlineview.entity.po.Document;

import java.util.List;

import org.apache.ibatis.annotations.*;

@Mapper
public interface DocumentMapper {
    @InsertProvider(value = DocumentProvider.class,method = "insert")
    int insert(Document record);

    @Select("select * from document where username = #{username} and course = #{course}")
    Document selectByPrimaryKey(@Param("username") String username, @Param("course") String course);

    @Select("select * from document where course = #{course}")
    List<Document> selectByCourse(String course);

    @UpdateProvider(value = DocumentProvider.class,method = "update")
    int updateByPrimaryKey(Document record);
}
